package com.qf.boot1.vo;

import java.util.HashMap;

/**
 * @author 刘欣
 * @createTime 2023/1/10 9:17
 * @description
 */

public class ResultVo extends HashMap {

    public static ResultVo ok() {
        ResultVo resultVo = new ResultVo();
        resultVo.put("code", 1);
        resultVo.put("msg", "ok");
        return resultVo;
    }

    public static ResultVo ok(Integer code, String msg) {
        ResultVo resultVo = new ResultVo();
        resultVo.put("code", code);
        resultVo.put("msg", msg);
        return resultVo;
    }

    public static ResultVo error() {
        ResultVo resultVo = new ResultVo();
        resultVo.put("code", -1);
        resultVo.put("msg", "error");
        return resultVo;
    }

    public static ResultVo error(String mgs) {
        ResultVo resultVo = new ResultVo();
        resultVo.put("code", -1);
        resultVo.put("msg", mgs);
        return resultVo;
    }
}
